import request from '@/config/axios'

// 图片 VO
export interface PictureVO {
  id: string // 唯一id
  fileId: string // 图片ID
  picName: string // 图片名
  pictureSortId: string // 分类id
  prompt: string // 关键词
}

// 图片 API
export const PictureApi = {
  // 查询图片分页
  getPicturePage: async (params: any) => {
    return await request.get({ url: `/ai/picture/page`, params })
  },

  // 查询图片详情
  getPicture: async (id: number) => {
    return await request.get({ url: `/ai/picture/get?id=` + id })
  },

  // 新增图片
  createPicture: async (data: PictureVO) => {
    return await request.post({ url: `/ai/picture/create`, data })
  },

  // 修改图片
  updatePicture: async (data: PictureVO) => {
    return await request.put({ url: `/ai/picture/update`, data })
  },

  // 删除图片
  deletePicture: async (id: number) => {
    return await request.delete({ url: `/ai/picture/delete?id=` + id })
  },

  // 导出图片 Excel
  exportPicture: async (params) => {
    return await request.download({ url: `/ai/picture/export-excel`, params })
  },

    // 查询图片分页
  getWebPicturePage: async (params: any) => {
    return await request.get({ url: `web/ai/picture/page`, params })
  },
}
